package wei.Entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.*;

@Entity
public class Student {

    @Id

    private int student_no;//学号
    private String student_name;//姓名
    private String sex;//性别
    private int grade;//年级
    private String class_no;//班级

    @ManyToMany(mappedBy = "stu")
    private Set<Course> cou = new HashSet<Course>();

    public Student() {
    }

    public Student(int student_no, String student_name, String sex, int grade, String class_no) {

        this.student_no = student_no;
        this.student_name = student_name;
        this.sex=sex;
        this.grade=grade;
        this.class_no=class_no;

    }
    public Set<Course> getCourse() {
        return cou;
    }

    public int getStudent_no() {
        return student_no;
    }
    public String getStudent_name() {
        return student_name;
    }
    public String getSex() {
        return sex;
    }

    public String getClass_no() {
        return class_no;
    }
    public int getGrade() {
        return grade;
    }

    public void setStudent_no(int student_no) {
        this.student_no =student_no;
    }

    public void setStudent_name(String student_name) {
        this.student_name = student_name;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public void setGrade(int grade){
        this.grade=grade;
    }
    public void setClass_no(String class_no) {
        this.class_no = class_no;
    }
    public void setCourses(Set<Course> cou) {
        this.cou=cou;
    }


}
